package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.system.domain.comment.EngComment;
import com.ruoyi.system.domain.comment.FileComment;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BEAfeng;
import com.ruoyi.system.service.IBEAfengService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;



/**
 * 工程管理审核后Controller
 * 
 * @author ruoyi
 * @date 2024-06-24
 */
@RestController
@RequestMapping("/system/afeng")
public class BEAfengController extends BaseController
{
    @Autowired
    private IBEAfengService bEAfengService;

    /**
     * 查询工程管理审核后列表
     */
    @GetMapping("/list")
    public TableDataInfo list(BEAfeng bEAfeng)
    {
        startPage();
        List<BEAfeng> list = bEAfengService.selectBEAfengList(bEAfeng);
        return getDataTable(list);
    }

    /**
     * 导出工程管理审核后列表
     */
    @Log(title = "工程管理审核后", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BEAfeng bEAfeng)
    {
        List<BEAfeng> list = bEAfengService.selectBEAfengList(bEAfeng);
        ExcelUtil<BEAfeng> util = new ExcelUtil<BEAfeng>(BEAfeng.class);
        util.exportExcel(response, list, "工程管理审核后数据");
    }



    /**
     * 查询工程注释信息列表
     *
     * @return 工程信息集合
     */
    @PostMapping("/getAfengComment")
    public List<EngComment> getAfengComment() {
        return bEAfengService.selectBEAfengComList();
    }




    /**
     * 获取工程管理审核后详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(bEAfengService.selectBEAfengById(id));
    }

    /**
     * 新增工程管理审核后
     */
    @Log(title = "工程管理审核后", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BEAfeng bEAfeng)
    {
        return toAjax(bEAfengService.insertBEAfeng(bEAfeng));
    }

    /**
     * 修改工程管理审核后
     */
    @Log(title = "工程管理审核后", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BEAfeng bEAfeng)
    {
        return toAjax(bEAfengService.updateBEAfeng(bEAfeng));
    }

    /**
     * 删除工程管理审核后
     */
    @Log(title = "工程管理审核后", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(bEAfengService.deleteBEAfengByIds(ids));
    }
}
